import React from 'react'
import { Tabs } from 'react-vant';
import { Swiper, Toast } from 'react-vant';
import { Grid } from 'react-vant';
import { ShopO } from '@react-vant/icons';

const colors = ['#ace0ff', '#bcffbd', '#e4fabd', '#ffcfac'];

 const items = colors.map((color, index) => (
  <Swiper.Item key={color}>
    <div
      onClick={() => {
        Toast.info(`你点击了卡片 ${index + 1}`);
      }}
    >
      {index + 1}
    </div>
  </Swiper.Item>
));

function Home() {
  return (
    <div>
        <div className="demo-tabs">
          <Tabs active={0}>
            {
              <Tabs.TabPane title="多点超市">
                  <div className="demo-swiper">
                    <Swiper autoplay={5000}>{items}</Swiper>
                  </div>
                  <Grid columnNum={5}>
                    {Array.from({ length: 15 }, (_, i) => (
                      <Grid.Item key={i} icon={<ShopO />} text="文字" />
                    ))}
                  </Grid>
              </Tabs.TabPane>
              
            }
            {
              <Tabs.TabPane title="全球精选">  
              </Tabs.TabPane>
            }
          </Tabs>
         
            
         
        </div>
    </div>
  )
}

export default Home